package test;

import top.malaoshi.util.Out;
import top.malaoshi.webmvc.MethodArgumentNameResolver2;

import java.io.IOException;
import java.lang.reflect.Method;

public class GetMethodParameterName {
    public static void main1(String[] args) throws ClassNotFoundException {
//        String[] names = MethodArgumentNameResolver.handler("test.controller.IndexCtrl","test");
        Class<?> clazz = Class.forName("test.LoginCtrl");
//        String[] names = MethodArgumentNameResolver.handler(clazz,"login");
//        Out.printArray(names);

//        Method[] declaredMethods = clazz.getDeclaredMethods();
//        for(Method method : declaredMethods) {
//            String[] names = MethodArgumentNameResolver.handler(clazz,"login");
//            Out.printArray(names);
//        }

    }

    public static void main(String[] args) throws ClassNotFoundException, IOException {
        Class<?> clazz = Class.forName("test.LoginCtrl");
        Method[] declaredMethods = clazz.getDeclaredMethods();
        for(Method method : declaredMethods) {
            String[] names = MethodArgumentNameResolver2.handle(method);
            Out.printArray(names);
        }
    }
}
